export function xhrFile(fileUrl) {
  const xhr = new XMLHttpRequest()
  xhr.open('GET', fileUrl, true)
  xhr.responseType = 'blob'
  return new Promise((resolve) => {
    xhr.onload = () => {
      if (xhr.status * 1 === 200) {
        resolve(xhr.response)
      }
    }
    xhr.send()
  })
}
export function saveAs(blob, fileName) {
  var link = document.createElement('a')
  link.href = window.URL.createObjectURL(blob)
  link.download = fileName
  link.click()
}